<template>
  <div>
    <input v-model="firstName" placeholder="输入姓">
    <input v-model="lastName" placeholder="输入名">
    <p>全名: {{ fullName }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      firstName: "",
      lastName: ""
    }
  },
  computed: {
    fullName() {
      return this.firstName + " " + this.lastName;
    }
  }
}
</script>